home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4863 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Open database.mdb file, HOW ?
  5. Date: 1 Feb 1996 11:53:23 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4eq9jj$7eh@news1.usa.pipeline.com>
  8. References: <310FC242.6128@geis.geis.com>
  9. NNTP-Posting-Host: pipe5.h1.usa.pipeline.com
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete)
  13. X-Newsreader: Pipeline USA v3.3.0
  14.  
  15. On Jan 31, 1996 14:25:54 in article <Re: Open database.mdb file, HOW ?>,
  16. 'westley <westley@geis.geis.com>' wrote: 
  17.  
  18.  
  19. >Peter Bohn wrote: 
  20. >>  
  21. >> Hello !!! 
  22. >>  
  23. >> How can I open a *.mdb file with C++-coding. Sitting here with 
  24. >> MS Vc++ 4.0, and I really don't know how. So please get me started with 
  25. >> some lines. 
  26. >>                 Peter 
  27. >Your first step is to find out the document structure of an mdb 
  28. >file. Some structurs are published in tech manuals IE. Ihave a 
  29. >programming book call Advance C which has the structure for 
  30. >DBASE. Once you know the structure it simple to write code  
  31. >to read one in. 
  32. Correct, except for one minor glitch:  The format of Microsoft 
  33. Access (.mdb) files is a closely guarded secret.  An ordinary 
  34. mortal can't get his/her hands on it. 
  35.  
  36. The simple answer is to use ODBC.  One way to do 
  37. this with the original poster's development system is to: 
  38.  
  39. 1.  Start a project with the Wizard, choosing database 
  40. support mode "Header files only". 
  41.  
  42. 2.  Use the Class Wizard to add a new class inheriting 
  43. from the CRecordset class. 
  44.  
  45. 3.  Follow the Wizard's instructions and use online docs 
  46. to accomplish what one wants to do. 
  47.  
  48. Note that the Class Wizard will automatically connect to 
  49. the database and get the column names for you.  You 
  50. can then decide which columns to bind.  Easy as pie! 
  51.  
  52. Note.  If you already have a project and didn't choose 
  53. the option in 1. above, just go to the file stdafx.h and 
  54. add the line "#include <afxdb.h> after all the other includes. 
  55.  
  56. Note.  You can use DAO instead of ODBC.  Almost the 
  57. same, just the names have been changed to protect.... 
  58.  
  59. -- 
  60. Pete Grant 
  61. Kalevi, Inc. 
  62. Object Oriented Software Development
  63.